package me.zhengjie.rest;

import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import me.zhengjie.service.PLCService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/plc")
@Api(tags = "读取PLC数据")
public class PLCController {

    private final PLCService plcService;

    @GetMapping("/querryAll")
    public ResponseEntity<Object> queryAll(){
        return new ResponseEntity<>(plcService.queryAll(), HttpStatus.OK);
    }
}
